{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "packs loaded\n"
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "import tensorflow as tf\n",
    "import matplotlib.pyplot as plt\n",
    "#from tensorflow.examples.tutorials.mnist import input_data\n",
    "import input_data\n",
    "\n",
    "print (\"packs loaded\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Download and Extract MNIST dataset\n",
      "Extracting data/train-images-idx3-ubyte.gz\n",
      "Extracting data/train-labels-idx1-ubyte.gz\n",
      "Extracting data/t10k-images-idx3-ubyte.gz\n",
      "Extracting data/t10k-labels-idx1-ubyte.gz\n",
      " tpye of 'mnist' is <class 'tensorflow.contrib.learn.python.learn.datasets.base.Datasets'>\n",
      " number of trian data is 55000\n",
      " number of test data is 10000\n"
     ]
    }
   ],
   "source": [
    "print (\"Download and Extract MNIST dataset\")\n",
    "mnist = input_data.read_data_sets('data/', one_hot=True)\n",
    "print\n",
    "print (\" tpye of 'mnist' is %s\" % (type(mnist)))\n",
    "print (\" number of trian data is %d\" % (mnist.train.num_examples))\n",
    "print (\" number of test data is %d\" % (mnist.test.num_examples))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "What does the data of MNIST look like?\n",
      " type of 'trainimg' is <class 'numpy.ndarray'>\n",
      " type of 'trainlabel' is <class 'numpy.ndarray'>\n",
      " type of 'testimg' is <class 'numpy.ndarray'>\n",
      " type of 'testlabel' is <class 'numpy.ndarray'>\n",
      " shape of 'trainimg' is (55000, 784)\n",
      " shape of 'trainlabel' is (55000, 10)\n",
      " shape of 'testimg' is (10000, 784)\n",
      " shape of 'testlabel' is (10000, 10)\n"
     ]
    }
   ],
   "source": [
    "# What does the data of MNIST look like? \n",
    "print (\"What does the data of MNIST look like?\")\n",
    "trainimg   = mnist.train.images\n",
    "trainlabel = mnist.train.labels\n",
    "testimg    = mnist.test.images\n",
    "testlabel  = mnist.test.labels\n",
    "print\n",
    "print (\" type of 'trainimg' is %s\"    % (type(trainimg)))\n",
    "print (\" type of 'trainlabel' is %s\"  % (type(trainlabel)))\n",
    "print (\" type of 'testimg' is %s\"     % (type(testimg)))\n",
    "print (\" type of 'testlabel' is %s\"   % (type(testlabel)))\n",
    "print (\" shape of 'trainimg' is %s\"   % (trainimg.shape,))\n",
    "print (\" shape of 'trainlabel' is %s\" % (trainlabel.shape,))\n",
    "print (\" shape of 'testimg' is %s\"    % (testimg.shape,))\n",
    "print (\" shape of 'testlabel' is %s\"  % (testlabel.shape,))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(55000, 784)\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "array([0., 0., 0., 0., 0., 0., 0., 1., 0., 0.])"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "print(trainimg.shape)\n",
    "# print(trainimg[0, :])\n",
    "trainlabel[0, :]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "How does the training data look like?\n",
      "[15194 38090]\n",
      "15194th Training Data Label is 1\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWEAAAFuCAYAAABQqakCAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAAPYQAAD2EBqD+naQAAHPJJREFUeJzt3X24JFVh5/HvDxBQjKKgkBUi4CgvWTU6BmIURNFFiQHU\nFYMmxBjXKGpc1xd8iyh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4668JC11ozZHvBC4\nF/BV4Kqex2Hd63cADwM+A/wQ+ADwbWC/UsrtY6ivJE2VUfsJzxrapZTbgCcvqEaStIw4doQkNWQI\nS1JDhrAkNWQIS1JDhrAkNWQIS1JDhrAkNWQIS1JDhrAkNWQIS1JDhrAkNWQIS1JDhrAkNWQIS1JD\nhrAkNWQIS1JDhrAkNWQIS1JDhrAkNWQIS1JDhrAkNbQYQnjr1hWQpAmZM98WQwjv0roCkjQhu8xV\nIKWUTVCPWSqQbAccCFwO3Na0MpI0HltTA3h1KeWG2Qo2D2FJWs4WQ3OEJC1bhrAkNWQIS1JDhrAk\nNWQIS1JDhrAkNWQIS1JD/x+f/7yqk3XOKgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x15791390>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "38090th Training Data Label is 3\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWEAAAFuCAYAAABQqakCAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAAPYQAAD2EBqD+naQAAIABJREFUeJzt3Xu0JGV57/HvAwwODiIKAjkHj1wGULKCAhKCBBhEzygq\nqCgGzEGiCQpIolEwBpPhiCckujjRCKOoEVEURVAhBhgJ4IUASgbwhlwPKDAXhosCwyDIPOePtzb0\nNL33VO/dm3fv3t/PWr1muvrpqre6ev+66u23qiMzkSTVsU7tBkjSTGYIS1JFhrAkVWQIS1JFhrAk\nVWQIS1JFhrAkVWQIS1JFhrAkVWQID4GIuD0izq/djjYi4qqIuGCcz/1qRPxi0G3S2jWv/YoBz7PV\neyEilkXEwkEueyoZyhCOiB0j4uyIuDUiVkbEioj4XkS8dpT6gyPiyoi4PyLuiYjvRsT+o9S+IyKu\nj4hVEXFTRLx7lLpXRsTlzfLvi4ivR8QLRql9WUft0oj4RETM6ap5UUQsiIj/0WMW4zr3PCJOj4jV\n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S9JMNhW6IyRpxjKEJakiQ1iSKjKEJakiQ1iSKjKE\nJakiQ1iSKvr/GC/0EiHBI60AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1603bf60>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# How does the training data look like?\n",
    "print (\"How does the training data look like?\")\n",
    "nsample = 2\n",
    "randidx = np.random.randint(trainimg.shape[0], size=nsample)\n",
    "print(randidx)\n",
    "\n",
    "for i in randidx:\n",
    "    curr_img   = np.reshape(trainimg[i, :], (28, 28)) # 28 by 28 matrix \n",
    "    curr_label = np.argmax(trainlabel[i, :] ) # Label\n",
    "    plt.matshow(curr_img, cmap=plt.get_cmap('gray'))\n",
    "    plt.title(\"\" + str(i) + \"th Training Data \" \n",
    "              + \"Label is \" + str(curr_label))\n",
    "    print (\"\" + str(i) + \"th Training Data \" \n",
    "           + \"Label is \" + str(curr_label))\n",
    "    plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Batch Learning? \n",
      "type of 'batch_xs' is <class 'tuple'>\n",
      "type of 'batch_ys' is <class 'numpy.ndarray'>\n",
      "shape of 'batch_xs' is (100, 784)\n",
      "shape of 'batch_ys' is (100, 10)\n"
     ]
    }
   ],
   "source": [
    "# Batch Learning? \n",
    "print (\"Batch Learning? \")\n",
    "batch_size = 100\n",
    "batch_xs, batch_ys = mnist.train.next_batch(batch_size)\n",
    "print (\"type of 'batch_xs' is %s\" % (type(batch_xs.shape)))\n",
    "print (\"type of 'batch_ys' is %s\" % (type(batch_ys)))\n",
    "print (\"shape of 'batch_xs' is %s\" % (batch_xs.shape,))\n",
    "print (\"shape of 'batch_ys' is %s\" % (batch_ys.shape,))\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "tuple"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tu = \"abc\",\n",
    "type(tu)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "kernelspec": {
   "display_name": "Python [default]",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
